package com.yzq.enums;

import lombok.Getter;

/**
 * 业务类型枚举 (业务类型（register，login，reset_password）)
 */
@Getter
public enum BusinessType {
    REGISTER("register","注册"),
    LOGIN("login","登录"),
    RESET_PASSWORD("reset_password","重置密码");
    private final String code;
    private final String message;
    BusinessType(String code, String message) {
        this.code = code;
        this.message = message;
    }
    public static String getMessageByCode(String code) {
        for (BusinessType value : values()) {
            if (value.code.equals(code)) {
                return value.message;
            }
        }
        return null;
    }
}
